import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/login",
      name: "首页",
      hidden: true,
      component: () => import("@/components/Login"),
    },
    {
      path: "/login",
      name: "Login",
      hidden: true,
      component: () => import("@/components/Login"),
    },
    {
      path: "/home",
      name: "学生管理",
      redirect: "/home/studentList",
      component: () => import("@/components/Home"),
      children: [
        {
          path: "/home/studentList",
          name: "学生列表",
          component: () => import("@/components/students/StudentList"),
        },
        {
          path: "/home/infoList",
          name: "信息列表",
          component: () => import("@/components/students/InfoList"),
        },
        {
          path: "/home/infoMgmt",
          name: "信息管理",
          component: () => import("@/components/students/InfoMgmt"),
        },
        {
          path: "/home/workList",
          name: "作业列表",
          component: () => import("@/components/students/WorkList"),
        },
        {
          path: "/home/workMgmt",
          name: "作业管理",
          component: () => import("@/components/students/WorkMgmt"),
        },
      ],
    },{
      path: "/data",
      name: "数据分析管理",
      component: () => import("@/components/Home"),
      children: [
        {
          path: "/data/dataView",
          name: "数据概览",
          component: () => import("@/components/dataAnalysis/DataView"),
        },
        {
          path: "/data/mapView",
          name: "地图概览",
          component: () => import("@/components/dataAnalysis/MapView"),
        },
        {
          path: "/data/travelMap",
          name: "旅游地图",
          component: () => import("@/components/dataAnalysis/TravelMap"),
        },
        {
          path: "/data/scoreMap",
          name: "分数地图",
          component: () => import("@/components/dataAnalysis/ScoreMap"),
        }
      ]
    },{
      path: "/user",
      name: "用户管理",
      component: () => import("@/components/Home"),
      children: [
        {
          path: "/user/userMgmt",
          name: "用户数据",
          component: () => import("@/components/users/UserMgmt"),
        }
      ]
    }
  ],
  mode: "history",
});
